package lpg.tool.templatec;

class TemplatecException extends RuntimeException
{
    TemplatecException(String msg, Control control)
    {
        super(msg);
        this.control = control;
    }

    void print()
    {
        System.out.println("***Error: " + getMessage());
        for (Control ctrl = control; ctrl != null; ctrl = ctrl.parentControl)
        {
            System.out.println("            " +
                    ctrl.templateFile.getAbsolutePath() + ":" + ctrl.lineNo);
        }
    }

    private final Control control;

}
